package com.gitee.wsl.compose.ui.lazy.tree

import androidx.compose.runtime.Composable

 interface InteractiveComponentState {
     val isActive: Boolean

     val isEnabled: Boolean

     val isHovered: Boolean

     val isPressed: Boolean
}


 interface FocusableComponentState : InteractiveComponentState {
     val isFocused: Boolean

    @Composable
     fun <T> chooseValue(normal: T, disabled: T, focused: T, pressed: T, hovered: T, active: T): T =
        when {
            !isEnabled -> disabled
            isPressed  -> pressed
            isHovered && isFocused  -> hovered
            isHovered && !isFocused -> active
            isFocused -> focused
            isActive -> active
            else -> normal
        }
}
